package tr.helper.controller.sprite;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import tr.helper.SingletonFactory;
import tr.helper.UserHolder;

public class SpriteMain extends Application {

    private static Stage instance = null;

    public static Stage getInstance() {
        if (null == instance) {
            instance = SingletonFactory.getWeakInstance(Stage.class, null);
        }
        return instance;
    }

    @Override
    public void start(Stage primaryStage) throws Exception {
        getInstance().setTitle("辅助中心 欢迎你:" + UserHolder.getInstance().getUser().getUsername());
        getInstance().setScene(new Scene(FXMLLoader.load(SpriteMain.class.getResource("SpriteForm.fxml"))));
        getInstance().show();
    }

}
